<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<s:set name="date_type" value="%{@com.japp.tools.common.SelectVal@getDataToDateType(quantizaTion.q_type)}"></s:set>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户更新</title>
<s:include value="/app_common/common.jsp"></s:include>
<!-- 表单验证start -->
<script src="<s:property value='webctx'/>/libs/js/form/validationRule.js" type="text/javascript"></script>
<script src="<s:property value='webctx'/>/libs/js/form/validation.js" type="text/javascript"></script>
<script src="<s:property value='webctx'/>/jsp/plan/engagein/engagein.js" type="text/javascript"></script>
<!-- 表单验证end -->
<!-- 日期选择框start -->
<script type="text/javascript" src="<s:property value='webctx'/>/libs/js/form/datePicker/WdatePicker.js"></script>
<!-- 日期选择框end -->
</head>
<body>
<div style="text-align: center;font-weight: bold;">量化考核计划<s:property value="quantizaTion.q_id==0?'新增':'修改'"/>(<s:property value="date_type"/>)</div>
	<div>
		<form name="form2" id="form2" method="post" target="frmright">
			<s:hidden name="quantizaTion.q_type"></s:hidden>
			<s:if test="quantizaTion.q_id==0">
			<%--所属人编码 --%>
			<s:hidden name="quantizaTion.q_submit_ucode" id="q_submit_ucode" value="%{#session.u_code}"></s:hidden>
			<%--所属人名称 --%>
			<s:hidden name="quantizaTion.q_submit_uname" id="q_submit_uname" value="%{#session.u_name}"></s:hidden>
			<%--所属分部--%>
			<s:hidden name="quantizaTion.q_submit_dpcode" id="q_submit_dpcode" value="%{#session.userltdcode}"></s:hidden>
			<%--所属分部--%>
			<s:hidden name="quantizaTion.q_submit_dpid" id="en_submit_dpid" value="%{#session.userltd}"></s:hidden>
			<%--所属分部名称--%>
			<s:hidden name="quantizaTion.q_submit_dpname" id="q_submit_dpname" value="%{#session.userltdname}"></s:hidden>
			<%--所属级别--%>
			<s:hidden name="quantizaTion.q_power" value="%{#session.u_power}"></s:hidden>
			</s:if>
			<s:else>
				<%--所属人编码 --%>
				<s:hidden name="quantizaTion.q_submit_ucode"></s:hidden>
				<%--所属人名称 --%>
				<s:hidden name="quantizaTion.q_submit_uname"></s:hidden>
				<%--所属分部--%>
				<s:hidden name="quantizaTion.q_submit_dpcode"></s:hidden>
				<%--所属分部--%>
				<s:hidden name="quantizaTion.q_submit_dpid"></s:hidden>
				<%--所属分部名称--%>
				<s:hidden name="quantizaTion.q_submit_dpname"></s:hidden>
				<%--所属级别--%>
				<s:hidden name="quantizaTion.q_power"></s:hidden>
			</s:else>
			<s:hidden name="quantizaTion.q_id" id="q_id"></s:hidden>
			<table class="tableStyle" style="line-height: 30px">
				<tr>
					<th width="50%">项目</th>
					<th width="50%">量化计划(个)</th>
				</tr>
				<tr>
					<td>客户拜访数:</td>
					<td>
						<input type="text" name="quantizaTion.q_khbfs" value="<s:property value='quantizaTion.q_khbfs'/>" class="validate[custom[onlyNumber]]" maxlength="9">
					</td>
				</tr>
				<tr>
					<td>个人潜在客户数:</td>
					<td>
						<input type="text" name="quantizaTion.q_qzkhs" value="<s:property value='quantizaTion.q_qzkhs'/>" class="validate[custom[onlyNumber]]" maxlength="9">
					</td>
				</tr>
				<tr>
					<td>机构潜在客户数:</td>
					<td>
						<input type="text" name="quantizaTion.q_jgqzkhs" value="<s:property value='quantizaTion.q_jgqzkhs'/>" class="validate[custom[onlyNumber]]" maxlength="9">
					</td>
				</tr>
				<tr>
					<td>潜在客户合计数:</td>
					<td>
						<input type="text" name="quantizaTion.q_sum_qzkhsj" value="<s:property value='quantizaTion.q_sum_qzkhsj'/>" class="validate[custom[onlyNumber]]" maxlength="9">
					</td>
				</tr>
				<tr>
					<td>个人开户数:</td>
					<td>
						<input type="text" name="quantizaTion.q_grkhs" value="<s:property value='quantizaTion.q_grkhs'/>" class="validate[custom[onlyNumber]]" maxlength="9">
					</td>
				</tr>
				<tr>
					<td>机构开户数:</td>
					<td>
						<input type="text" name="quantizaTion.q_jgkhs" value="<s:property value='quantizaTion.q_jgkhs'/>" class="validate[custom[onlyNumber]]" maxlength="9">
					</td>
				</tr>
				<tr>
					<td>开户合计数:</td>
					<td>
						<input type="text" name="quantizaTion.q_khshj" value="<s:property value='quantizaTion.q_khshj'/>" class="validate[custom[onlyNumber]]" maxlength="9">
					</td>
				</tr>
				<tr>
					<td>个人入金交易数:</td>
					<td>
						<input type="text" name="quantizaTion.q_grrjjjs" value="<s:property value='quantizaTion.q_grrjjjs'/>" class="validate[custom[onlyNumber]]" maxlength="9">
					</td>
				</tr>
				<tr>
					<td>机构入金交易数:</td>
					<td>
						<input type="text" name="quantizaTion.q_jgrrjjs" value="<s:property value='quantizaTion.q_jgrrjjs'/>" class="validate[custom[onlyNumber]]" maxlength="9">
					</td>
				</tr>
				<tr>
					<td>入金交易合计数:</td>
					<td>
						<input type="text" name="quantizaTion.q_sum_rrjjhj" value="<s:property value='quantizaTion.q_sum_rrjjhj'/>" class="validate[custom[onlyNumber]]" maxlength="9">
					</td>
				</tr>
				<tr>
					<td>50万元以上交易数:</td>
					<td>
						<input type="text" name="quantizaTion.q_wswyis" value="<s:property value='quantizaTion.q_wswyis'/>" class="validate[custom[onlyNumber]]" maxlength="9">
					</td>
				</tr>
				<tr>
					<td>计划提交时间:</td>
					<td>
						<s:if test="quantizaTion.q_type==1">
							<input name="obj_date" type="text" maxDate="%y-%M-{%d+1}" dateFmt="yyyy-MM-dd"  value="<s:property value='quantizaTion.q_submit_date'/>" class="date validate[required]" style="cursor: pointer;" >
						</s:if>
						<s:elseif test="quantizaTion.q_type==2">
							<input name="obj_date" type="text" maxDate="<s:property value='@com.japp.tools.common.Common@checkDateByType(2)'/>" dateFmt="yyyy-MM-dd" isShowWeek="true" value="<s:property value='quantizaTion.q_submit_date'/>" class="date validate[required]" style="cursor: pointer;" >
						</s:elseif>
						<s:elseif test="quantizaTion.q_type==3">
							<input name="obj_date" type="text" maxDate="<s:property value='@com.japp.tools.common.Common@checkDateByType(3)'/>" dateFmt="yyyy-MM" value="<s:property value='quantizaTion.q_submit_date'/>" class="date validate[required]" style="cursor: pointer;" >
						</s:elseif>
						<s:elseif test="quantizaTion.q_type==4">
							<div style="float:left;"><input name="obj_date"type="text" maxDate="<s:property value='@com.japp.tools.common.Common@checkDateByType(7)'/>" dateFmt="yyyy" value="<s:property value='quantizaTion.q_submit_date'/>" class="date validate[required]" style="cursor: pointer;" ></div>
							<div style="float:left;"><select name="obj_cdate" class="validate[required]" selectedValue="<s:property value='obj_cdate'/>" data='<s:property value='@com.japp.tools.common.Common@checkDateByType(4)'/>'></select></div>
						</s:elseif>
						<s:elseif test="quantizaTion.q_type==5">
							<div style="float:left;"><input name="obj_date" type="text" maxDate="<s:property value='@com.japp.tools.common.Common@checkDateByType(7)'/>" dateFmt="yyyy" value="<s:property value='quantizaTion.q_submit_date'/>" class="date validate[required]" style="cursor: pointer;" ></div>
							<div style="float:left;"><select name="obj_cdate" class="validate[required]" selectedValue="<s:property value='obj_cdate'/>" data='<s:property value='@com.japp.tools.common.Common@checkDateByType(5)'/>'></select></div>
						</s:elseif>
						<s:elseif test="quantizaTion.q_type==6">
							<input name="obj_date" type="text" maxDate="<s:property value='@com.japp.tools.common.Common@checkDateByType(6)'/>" dateFmt="yyyy" value="<s:property value='quantizaTion.q_submit_date'/>" class="date validate[required]" style="cursor: pointer;" >
						</s:elseif>
					</td>
				</tr>
				<tr>
					<td colspan="8" align="center">
					<input type="button" onclick="back()" value="返回" />&nbsp;&nbsp;
					<input type="button" id="btn1" onclick="checkSubmit()" value="提交" />
					</td>
				</tr>
			</table>
		</form>
	</div>
</body>
<script type="text/javascript">
var status = "<s:property value='quantizaTion.q_id' />";
function checkSubmit(){
	var actionUrl;
	var valid = $("#form2").validationEngine({returnIsValid: true});
	if(!valid){
		return false;
	}
	if(status=="0"){
		actionUrl = webctx+"/plan/qt_insertQuantizaTionById.action";
	}else{
		actionUrl = webctx+"/plan/qt_updateQuantizaTionById.action";
	}
	//提示
	$('input[type="text"][name^="quantizaTion.q_"]').each(function(){
		if(nullBooleanNumber($(this).val())){
			$(this).val('0');
		}
	});
	var actionData = $("#form2").serialize();
	showProgressBar();
	$.ajax({
		url:actionUrl,
		data:actionData,
		type : "post",
		cache : false,
		dataType : 'text',
		success : function(data) {
			if(data!=0){
				alert('操作成功!');
				if(status==0){
					window.parent.frmrightChild.location = webctx+"/plan/qt_queryQuantizaTion.action?quantizaTion.q_type=<s:property value='quantizaTion.q_type'/>";
				}
			}else{
				alert('操作失败!');
			}
			closeProgress();
		}
	});
}
function back(){
	top.Dialog.confirm("确认返回？",function(){
		showProgressBar();
		window.parent.frmrightChild.location = webctx+"/plan/qt_queryQuantizaTion.action?quantizaTion.q_type=<s:property value='quantizaTion.q_type'/>";
	});
}
$(function(){
	//提示
	$('input[type="text"][name^="quantizaTion.q_"]').bind('focus',function(){
		if(nullBooleanNumber($(this).val())){
			$(this).val('');
		}
	}).bind('blur',function(){
		if(nullBooleanNumber($(this).val())){
			$(this).val('0');
		}
	});
});
</script>
</html>